package asteroids.model.expressions;

import java.util.HashMap;
import asteroids.model.*;

/**
 * A subclass of expression (E) that represents a variable
 * 
 * @version 1.0
 * 
 * @author	Thijs Peirelinck & Wouter Parys
 *
 */
public class Variable extends BasicExpression {
        
        private String name;
        
        public Variable(String name) {
                this.name = name;
        }
        
        @Override
        public String getValue() {
                return name;
        }
        
        
        @Override
        public boolean isValidExpression() {
                //wanneer niet valid?
                return true;
        }
        
        @Override
        public String getReturnType() {
                return "String";
        }
        
        @Override
        public String toString() {
            return name;
        }

		@Override
		public Variable createCopy() {
			return new Variable(this.getValue());
		}
		
		@Override
		public void setExecuter(Ship executer) {
			//do nothing
		}
		
		@Override
		public void validate(HashMap<String, E> variables) {
			//do nothing (unreachable)
		}
        

}
